package com.atme.micromall.member.quartz;

//import com.dataojo.quartz.util.SchedulerUtils;
import org.quartz.*;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author lilinchao
 * @date 2021/9/2
 * @description 1.0
 **/
@PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class QuartzJobFirst extends QuartzJobBean {
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext){
/*        SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        List<JobExecutionContext> executionContexts;
        try {
            executionContexts = SchedulerUtils.getScheduler().getCurrentlyExecutingJobs();
        } catch (SchedulerException e) {
            e.printStackTrace();
            return;
        }
        for (JobExecutionContext executionContext : executionContexts){
            JobKey jobKey = executionContext.getJobDetail().getKey();
            Date fireTime = executionContext.getFireTime();
            System.out.println(jobKey+",对应的执行时间是"+sf.format(fireTime));
        }
        System.out.println("QuartzJobFirst执行时间是"+sf.format(new Date()));*/
        //System.out.println(1);


    }
}